<?php

use Illuminate\Database\Seeder;
use App\Models\Course;
class CourseSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        $faker = \Faker\Factory::create();
        for ($i = 0; $i < 100; $i++) {
            Course::create([
                'course_sort_id' => $faker->numberBetween(1, 9),
                'is_original'=>1,
                'doc_studio_id' => 0,
                'nums' => $faker->numberBetween(1, 2),
                'course_title' =>$faker->unique()->name,
                'course_info'=>'简介简介简介简介',
                'buy_num' => $faker->numberBetween(1, 2),
                'visit'=>$faker->numberBetween(1, 200),
                'racking'=>$faker->numberBetween(1, 2),
                'audit_status'=>$faker->numberBetween(1, 2),
                'lesson_isbuy'=>$faker->numberBetween(1, 2),
                'course_price'=>$faker->randomFloat(2, 0, 10),
                'course_score'=>$faker->numberBetween(1, 200),
                'add_user_id'=>$faker->numberBetween(1, 20),
                'course_img'=>'images/0f95d8f6fc2e547a0c3320bfb0d86756.png',
                'detail_images' => json_encode(["1710228911960287908.jpg", "17102289112111825593.png"]),
            ]);
        }
    }
    /**
     * `video_course_id` int(11) NOT NULL DEFAULT '0' COMMENT '课程分类表ID',
    `doc_studio_id` int(11) NOT NULL DEFAULT '0' COMMENT '医护工作室后台添加工作室为空',
    `nums` int(11) NOT NULL COMMENT '课程数',
    `course_title` varchar(50) NOT NULL COMMENT '课程标题',
    `buy_num` int(11) NOT NULL COMMENT '销量',
    `lesson_isbuy` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否收费(0:免费,1:收费)',
    `course_price` decimal(8,2) NOT NULL COMMENT '价格',
    `course_score` double(8,2) NOT NULL COMMENT '评分',
    `course_img` varchar(255) DEFAULT '' COMMENT 'logo',
    `course_info` text COMMENT '简介',
    `course_images` text COMMENT '图集',
     */
}
